home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
5_10.lha
/
5_10
/
5_10c3.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-08
|
661b
|
29 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
/ Get the type and address back for a given variable.
/ Also return an indication of whether we had to
/ allocate the variable here.
include <string.h>
nt tableentry::getvardata(char *nm, vardata **addr)
name *n = tbl->lookfor(nm);
// name not found, allocate its data now
if (!n)
{
// the last char is the type of the variable
char *lastchar = strchr(nm, '\0') - 1;
*addr = settype(nm, *lastchar);
return 1;
}
// the name is there, return its data
else
{
*addr = (vardata*)(n->pvalue);
return 0;
}